define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'buddha.order/index',
        add_url: 'buddha.order/add',
        edit_url: 'buddha.order/edit',
        delete_url: 'buddha.order/delete',
        export_url: 'buddha.order/export',
        modify_url: 'buddha.order/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id', search: false},
                    {field: 'order_id', title: '订单号', width: 220, searchOp: "%*%"},
                    {field: 'getCate.title', title: '捐款类型', width: 100,search: false},
                    {field: 'money', title: '捐款金额', width: 100,search: false},
                    {
                        field: 'payment',
                        search: 'select',
                        selectList: ["未支付", "支付成功", "支付失败", "订单退款"],
                        title: '支付状态',
                        width: 100
                    },
                    {field: 'get_payment_time', title: '支付时间', width: 180, search: 'range'},
                    {field: 'create_time', title: '创建时间', width: 180, search: 'range'},
                    {
                        width: 250, title: '操作', templet: ea.table.tool, operat: ['delete']
                    },
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});